<template lang="pug">
  #app
    router-view(v-if="pc")
    router-view(name="mobile" v-else)
</template>

<script>
import Pc from './components/Pc.vue'
import Mobile from './components/Mobile.vue'
import VueRouter from 'vue-router'
import hd from './utils/hd.js'


const router = new VueRouter({
  routes: [
    {
      path: '/',
      components: {
        default: Pc,
        mobile: Mobile
      }
    }
  ]
})
export default {
  name: 'app',
  data: function(){
    return {
      pc: true,
    }
  },
  components: {
  },
  router,
  created() {
    this.boolean_pc()
  },
  mounted() {
    hd();
  },
  methods: {
    boolean_pc: function() {
      if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
        this.pc = !this.pc;
      }
    }
  },
}
</script>

<style>

</style>
